package com.ruoyi.coffee.controller;
import com.ruoyi.coffee.dto.QueryCouponDto;
import com.ruoyi.coffee.service.ICouponService;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxj
 * @Description 优惠券
 * @date 2025/1/8 21:09
 */
@RestController
@RequestMapping("/coupon")
@AllArgsConstructor
@Slf4j
@Api(tags = "用户优惠券")
public class CouPonController {
    private ICouponService iCouponService;

    /**
     * 分页查询优惠券
     * @param queryCouponDto
     * @return
     */
    @GetMapping("/list")
    @ApiOperation(value = "分页查询优惠券", notes = "分页查询优惠券")
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功", response = AjaxResult.class)
    })
    public AjaxResult getAddressesList(QueryCouponDto queryCouponDto) {
        return iCouponService.getCouponList(queryCouponDto);
    }
}
